1. Field of the Invention
The present invention relates to an information processing apparatus, a control method for controlling the same, and a storage medium.
2. Description of the Related Art
In recent years, even among printing apparatuses such as multifunctional printers or printers, the number of apparatuses equipped with a wireless LAN function has been increasing. A printing apparatus equipped with the wireless LAN function can be wirelessly connected as a client to an access point. On the other hand, a PC or a mobile terminal performs communication with the printing apparatus via the access point, transmitting print data to the printing apparatus to be printed, and receiving device information from the printing apparatus to be used for device control.
In relation to the above-described wireless LAN, a standard called Wi-Fi Direct® has been established by Wi-Fi Alliance. In Wi-Fi Direct, a protocol for determining whether each wireless terminal operates as an access point or a client is defined. By executing this protocol, it is possible to automatically determine which wireless terminal operates as an access point and which wireless terminal operates as a client. When this Wi-Fi Direct is used, one of the wireless terminals automatically operates as an access point without needing a separate access point, thus enabling direct wireless communication to be executed between the wireless terminals. Various types of application services (such as image sharing and printing) can be executed between wireless terminals by using Wi-Fi Direct.
Moreover, as a technique for performing printing from terminals such as mobile terminals, WSD (Web Service on Device) exists. In WSD, a WS-Eventing (Web Services Eventing) technique is used as a mechanism of event notifications to a terminal in order to monitor the state of the image forming apparatus and the state of jobs (refer to “Web Services Eventing (WS-Eventing)”, Internet <URL: http://www.w3.org/Submission/WS-Eventing/>). In the case of executing printing on the image forming apparatus using terminal WSD, the terminal performs registration, in the image forming apparatus, regarding event notifications to be received using WS-Eventing. Specifically, the terminal registers the content of events and notification destinations in the image forming apparatus. Accordingly, the terminal can obtain, from the image forming apparatus that is to execute printing, a notification regarding the state of the image forming apparatus and the state of a job. When an event registered by the terminal occurs, the image forming apparatus transmits the event notification regarding the event that has occurred to the registered notification destination. The event registered in the image forming apparatus is effective until a designated expiration date of an effective period is reached or until the terminal performs termination notification for the event notification, to the image forming apparatus.
In the case where a terminal is connected to an image forming apparatus such as a multifunctional printer or a printer using Wi-Fi Direct and printing is executed using WSD, the terminal, after being connected to the image forming apparatus, performs the above-described registration regarding the event notification in the image forming apparatus. After transmitting print data (print job) to the image forming apparatus to start printing, the terminal can check the state of the image forming apparatus and the execution state of the print job by using the event notification transmitted from the image forming apparatus.
However, it is possible that the terminal disconnects the Wi-Fi Direct connection to the image forming apparatus after transmission of the print data. Examples of such situations include the case where the terminal performs a new wireless LAN connection or a new Wi-Fi Direct connection with another apparatus or access point, and the case where the terminal is moved out of the communication range of Wi-Fi Direct with the image forming apparatus, for example. There is also the case where the number of connections (that is, the number of communication sessions) using Wi-Fi Direct to the image forming apparatus reaches an upper limit and communication between the terminal and the image forming apparatus has not occurred for a certain period of time.
In such cases, the image forming apparatus can no longer transmit event notifications to the terminal. Moreover, unless the terminal requests the image forming apparatus to cancel registration regarding event notifications, registration information can remain in the image forming apparatus. In this case, due to a limited storage capacity of the image forming apparatus, it is possible that another terminal cannot newly perform registration regarding event notifications in the image forming apparatus. Furthermore, in the case where another terminal connects to the image forming apparatus using Wi-Fi Direct in place of the terminal that has disconnected the Wi-Fi Direct connection and the IP addresses of both these terminals are identical, it is possible for the image forming apparatus to transmit an event notification to the incorrect notification destination. That is, a security problem can arise.
As a technique for addressing the above-described problem, Japanese Patent Laid-Open No.2010-113400 proposes a technique for, when a registered event occurs and an event notification is transmitted, confirming whether or not the registered notification destination exists, and canceling information regarding that notification destination in the case where the destination does not exist.
However, the printer in Japanese Patent Laid-Open No.2010-113400 does not perform cancellation of the notification destination regarding the registered event unless that event occurs. For example, unless an event in which that terminal serves as the notification destination occurs, the registration regarding that event remains without being canceled, even after the WiFi-Direct connection between the printer and the terminal is disconnected. Moreover, in the case where another terminal connects to the printer using Wi-Fi Direct in place of the terminal that has disconnected the Wi-Fi Direct connection and the IP addresses of both these terminals are identical, the notification destination will not be canceled due to the existence of a registered notification destination. As described above, it can be said that it is difficult to sufficiently address the above-described problem using the technique described in Japanese Patent Laid-Open No.2010-113400.